const sequelize = require('sequelize');

module.exports = app => {
    const { INTEGER, BOOLEAN } = app.Sequelize;
    const Role = app.model.define('crawler', {
        id: { type: sequelize.INTEGER, primaryKey: true, autoIncrement: true },
        visitLimit: {
            type: BOOLEAN,
            defaultValue: true
        },
        visitLimitPerDays: {
            type: INTEGER,
            defaultValue: 100
        },
        redundantDom: {
            type: BOOLEAN,
            defaultValue: false
        },
        ipDetect: {
            type: BOOLEAN,
            defaultValue: true
        },
        httpDetect: {
            type: BOOLEAN,
            defaultValue: true
        },
        downLimit: {
            type: BOOLEAN,
            defaultValue: false,
        },
        downLimitPerDays: {
            type: INTEGER,
            defaultValue: 20
        }

    });

    return Role;
};